using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DX_SourceOutliner
{
    public class FilterByNameProcessor : ITreeProcessor
    {
        private string _filterPattern;
        public FilterByNameProcessor(string filterPattern)
        {
            _filterPattern = filterPattern;
        }

        public IEnumerable<TreeNode> Process(IEnumerable<TreeNode> nodes)
        {
            List<TreeNode> results = new NodeFilter().GetMatchingNodes(nodes, _filterPattern).ToList();
            
            return results;
        }
    }
}
